<%@ taglib uri="/tld/extremecomponents" prefix="ec" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

	<script src = "../js/jquery-1.12.1.js" type = "text/javascript"></script>
	<script src = "../js/jquery.validate.js" type = "text/javascript"></script>
	<script src = "../js/messages_zh.js" type = "text/javascript"></script>
	<script src = "../js/common.js" type = "text/javascript"></script>
	
	<link href="<%=request.getContextPath() %>/css/extremecomponents.css" rel="stylesheet" type="text/css" />
	<link href="<%=request.getContextPath() %>/css/global.css" rel="stylesheet" type="text/css" />
	<title></title>
	<style>
		#AddUserForm label.error {
			margin-left: 10px;
			width: auto;
			color:red;
			display: inline;
		}
	</style>

<script>

$(function() {
	//增加/修改
		$("#btnadd").click(function() {
			var course_name = $("#COURSE_NAME").val();
			var stu_id = $("#STU_ID").val();
			var total_scores = $("#TOTAL_SCORES").val();
			
		    if(total_scores==null || total_scores=="" || total_scores==''){
		        alert("修正成绩不可为空！");
		        return false;
		    }
		    else if(stu_id==null ||stu_id==""||stu_id==''){
		    	alter("学号不能为空");
		    	return false;
		    }else{
		        $.ajax({
		            type : "post",
		            dataType : "text",
		            url : "test?ActionType=test_stuAdd",
		            data : $("#AddScoreForm").serialize(),
		            success : function(massage) {
		                if (massage == 'success') {
		                	//goTo("test?ActionType=test_ViewInit");
		                	alter("添加成功！");
		                }
		                if (massage == 'fail') {
		                	alert("添加失败！");
		                }
		            }
		        });
		    }
		 });

	    //返回
	    $("#btnreturn").click(function() {
	    	goTo("test?ActionType=test_ViewInit");
	    });
		});
		 
</script>

</head>
<body>
    
   			<div id="current">当前位置：考试成绩管理&gt;添加成绩</div>
	    

    <form id="AddScoreForm" name="AddScoreForm" method="post">
        <table width="600" height="10" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
                <td height="30" align="center" class="xxpage">
                	<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                        <tr>
                            <td width="14%" class="xxpage_td2">课程号：</td>
                            <td width="86%" class="xxpage_td2">
                              	<input name="COURSE_ID" id="COURSE_ID" type="text" readonly = 'readonly'
                              value="<c:out value="${TESTINFO[0].chose_course_id}"/>" />
                            </td>
                        </tr>
                        <tr>
                            <td width="14%" class="xxpage_td2">课程名：</td>
                            <td width="86%" class="xxpage_td2">
                              	<input name="COURSE_NAME" id="COURSE_NAME" type="text" readonly = 'readonly'
                              value="<c:out value="${TESTINFO[0].course_name}"/>" />
                            </td>
                        </tr>
                         <tr>
                            <td width="14%" class="xxpage_td2">教师号：</td>
                            <td width="86%" class="xxpage_td2">
                              	<input name="TEACHER_ID" id="TEACHER_ID" type="text" readonly = 'readonly'
                              value="<c:out value="${TESTINFO[0].chose_course_teacher_id}"/>" />
                            </td>
                        </tr>
                        <tr>
                            <td width="14%" class="xxpage_td2">学生学号：</td>
                            <td width="86%" class="xxpage_td2">
                              	<input name="STU_ID" id="STU_ID" type="text"  />
                            </td>
                        </tr>
                        
                        <tr>
                            <td class="xxpage_td2">成绩：</td>
                            <td width="86%" class="xxpage_td2">
                              <input name="TOTAL_SCORES" id="TOTAL_SCORES" type="text" 
                              value="<c:out value="${USERINFO1.deptName}"/>" />
                            </td>
                        </tr>
                         
                    </table>
                 </td>
            </tr>
        </table>
        <table width="100%" border="0" cellpadding="0" cellspacing="0">
            <tr>
                <td width="49%" height="40" align="right"><input id="btnadd" name="btnadd" type="button" class="btn_2" value="确认" /></td>
                <td width="2%" align="center">&nbsp;</td>
                <td align="left"><input id="btnreturn" name="btnreturn" type="button" class="btn_2" value="返回" /></td>
            </tr>
        </table>
    </form>

</body>
</html>